package com.beck.bee.sort;

/**
 * Created by cdliubei@jd.com on 4/13/2017.
 */
public class BubbleSort {

    void doBubbleSort(int[] array){
        for(int i=0;i<array.length-1;i++){//外层循环控制排序趟数
            for(int j=0;j<array.length-1-i;j++){//内层循环控制每一趟排序多少次
                if(array[j]>array[j+1]){
                    int temp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=temp;
                    }
                }
            }
    }
}
